var Scrolling=false;

function $S(o){return document.getElementById(o)}

function ScroMove(){Scrolling=true}

document.onmousemove=function(e){if(Scrolling==false)return;ScroNow(e)}

document.onmouseup=function(e){Scrolling=false}

function ScroNow(event){
 var event=event?event:(window.event?window.event:null);
 var Y=event.clientY-$S("product").getBoundingClientRect().top-$S("ScroLine").clientHeight/2;
 var H=$S("Scroll").clientHeight-$S("ScroLine").clientHeight;
 var SH=Y/H*($S("contents").scrollHeight-$S("contents").clientHeight);
 if (Y<0)Y=0;if (Y>H)Y=H;
 $S("ScroLine").style.top=Y+"px";
 $S("contents").scrollTop=SH;
 }
 
function ScrollWheel(){
 var Y=$S("contents").scrollTop;
 var H=$S("contents").scrollHeight-$S("contents").clientHeight;
 if (event.wheelDelta >=120){Y=Y-80}else{Y=Y+80}
 if(Y<0)Y=0;if(Y>H)Y=H;
 $S("contents").scrollTop=Y;
 var SH=Y/H*$S("Scroll").clientHeight-$S("ScroLine").clientHeight;
 if(SH<0)SH=0;
 $S("ScroLine").style.top=SH+"px";
}
// JavaScript Document